package com.ardf.service;

import com.ardf.entity.Grade;
import com.ardf.entity.dto.GradeTableDto;
import com.ardf.entity.dto.StartGamePersonTableDto;
import com.ardf.entity.dto.StartGameRelayTableDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ShiYunHao
 * @since 2025-01-06
 */
public interface IGradeService extends IService<Grade> {
    /**
     *分页
     */
    Page<GradeTableDto> searchAll(Integer pageSize, Integer pageNum, Long competitionId, Long projectId, Boolean isLastResultDecided);

    /**
     * 开始比赛个人分页
     */
    Page<StartGamePersonTableDto> startGameSearchAllPerson(Integer pageSize, Integer pageNum, Long projectId, Boolean isTerminal, Long groupId);
    /**
     * 开始比赛接力分页
     */
    Page<StartGameRelayTableDto> startGameSearchAllRelay(Integer pageSize, Integer pageNum, Long projectId, Boolean isTerminal, Long groupId);

    /**
     * author:容伟洪
     * time:2025-3-5
     * description：根据选手id和项目id查询成绩信息
     */
    Grade selectByProIdAndAthId(Long projectId,Long athleteId);

    /**
     * author:容伟洪
     * time:2025-3-7
     * description：根据接力队伍id和项目id查询成绩信息
     */
    Grade selectByProIdAndTId(Long projectId,Long athleteId);

    /**
     * author:容伟洪
     * time:2025-3-5
     * description：根据成绩id更新路线和用时
     */
    boolean updateById(Grade grade);

    /**
     * author:容伟洪
     * time:2025-3-6
     * description：查询某条具体的成绩信息,涵盖多种其他信息
     */
    StartGamePersonTableDto startGameSearchOnlyPerson(Long gradeId);

    StartGameRelayTableDto startGameSearchOnlyTeam(Long groupId);


}
